gtkentry: Use symbolic names for button numbers
authorCarlos Garcia Campos <cgarcia@igalia.com>
Wed, 25 Jan 2012 17:28:36 +0000 (18:28 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Fri, 27 Jan 2012 08:47:43 +0000 (09:47 +0100)
gtk/gtkentry.c

index 3d76e8c7288d179f7cce44ef535d67611cb27769..a69fc23536d16d1c4a3973ef2d24eba86167efd9 100644 (file)
@@ -3788,7 +3788,7 @@ gtk_entry_button_press (GtkWidget      *widget,
 
       return TRUE;
     }
-  else if (event->button == 1)
+  else if (event->button == GDK_BUTTON_PRIMARY)
     {
       gboolean have_selection = gtk_editable_get_selection_bounds (editable, &sel_start, &sel_end);
 
@@ -3898,7 +3898,7 @@ gtk_entry_button_press (GtkWidget      *widget,
 
       return TRUE;
     }
-  else if (event->button == 2 && event->type == GDK_BUTTON_PRESS)
+  else if (event->button == GDK_BUTTON_MIDDLE && event->type == GDK_BUTTON_PRESS)
     {
       if (priv->editable)
         {
@@ -4033,7 +4033,7 @@ gtk_entry_motion_notify (GtkWidget      *widget,
       priv->mouse_cursor_obscured = FALSE;
     }
 
-  if (event->window != priv->text_area || priv->button != 1)
+  if (event->window != priv->text_area || priv->button != GDK_BUTTON_PRIMARY)
     return FALSE;
 
   if (priv->select_lines)
@@ -6444,7 +6444,7 @@ paste_received (GtkClipboard *clipboard,
   GtkEditable *editable = GTK_EDITABLE (entry);
   GtkEntryPrivate *priv = entry->priv;
 
-  if (priv->button == 2)
+  if (priv->button == GDK_BUTTON_MIDDLE)
     {
       gint pos, start, end;
       pos = priv->insert_pos;